package com.yanqu.road.logic.manager;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.security.Provider;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class DataAnalyticsMgr  implements ApplicationRunner {

    private static Logger logger = LogManager.getLogger(DataAnalyticsMgr.class.getName());

    public static DataAnalyticsMgr instance;

    //各渠道埋点
    private static Map<Integer, Provider> channelProvider = new ConcurrentHashMap<>();

    @Override
    public void run(ApplicationArguments args) throws Exception {
        //读取配置

        //读取各渠道的埋点地址
    }

    @PostConstruct
    public void init() {
        instance = this;
    }

    //埋点开启状态
    //渠道-区服-是否开启埋点
    private static Map<Integer, Map<Integer, Integer>> channelServerStatusMap = new ConcurrentHashMap<>();

    //定时检测状态
    public static void checkChannelProviderStatus(){

        //发送http 去检测

    }


}
